<?php

namespace app\common\service\trainer;


use app\common\model\banxi\core\CoreTrainerMonthSalaryDetail;
use app\common\service\ApiService;

class TrainerMonthSalaryDetailService extends ApiService
{
    public function listDetailByMonthSalaryId($monthSalaryId)
    {
        $coreTrainerMonthSalaryDetailModel = new CoreTrainerMonthSalaryDetail();
        return $coreTrainerMonthSalaryDetailModel->where([
            'monthSalaryId' => $monthSalaryId,
            'isCancel' => 0
        ])->field('`describe`,price,sum(num) as num,sum(total) as total')
            ->group(['describe', 'price'])
            ->order(['project' => 'asc'])
            ->select();
    }
}